<c:if test="#{mode != 'after_view' and mode != 'tab_content'}"
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:nxu="http://nuxeo.org/nxweb/util"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:nxl="http://nuxeo.org/nxforms/layout">

<c:if test="false">
  WARN: deprecated template since 8.2, see widgets subdirectory
</c:if>

  <nxu:set var="resolvedMode"
    value="#{nxu:test(empty action.properties.widgetMode, widget.mode, action.properties.widgetMode)}">
  <nxu:set var="displayActionLabel"
    value="#{action.properties.displayActionLabel}"
    cache="true">
  <nxu:set var="displayWidgetLabel"
    value="#{action.properties.displayWidgetLabel}"
    cache="true">
  <nxu:set var="widgetId"
    value="#{widget.id}"
    cache="true">

    <c:if test="#{displayActionLabel}">
      <ui:include src="/incl/action/action_icon_label_template.xhtml" />
      <h:outputText value=" " />
    </c:if>

    <nxl:widget
      name="#{action.properties.widgetName}"
      mode="#{resolvedMode}"
      category="#{empty action.properties.widgetCategory ? '': action.properties.widgetCategory}"
      layoutName="#{widget.name}"
      value="#{fieldOrValue}"
      resolveOnly="true">
      <nxu:form id="#{widget.id}_form"
        skip="#{!widgetControl_requireSurroundingForm}"
        useAjaxForm="#{widgetControl_useAjaxForm}"
        disableMultipartForm="#{widgetControl_disableMultiPartForm}"
        styleClass="subWidgetForm"
        disableDoubleClickShield="#{widgetControl_disableDoubleClickShield}">
        <c:if test="#{action.properties.displayWidgetLabel}">
          <ui:include src="/widgets/incl/widget_label_template.xhtml" />
          <h:outputText value=" " />
        </c:if>
        <nxl:widget widget="#{widget}" value="#{fieldOrValue}" />
      </nxu:form>
    </nxl:widget>

  </nxu:set>
  </nxu:set>
  </nxu:set>
  </nxu:set>

</c:if>